/**
 * 表情
 */


var ImgIputHandler={
	facePath:[
	    {faceName:"微笑",facePath:"weixiao.gif"},
		{faceName:"撇嘴",facePath:"piezui.gif"},
		{faceName:"色",facePath:"se.gif"},
		{faceName:"发呆",facePath:"fadai.gif"},
		{faceName:"得意",facePath:"deyi.gif"},
		{faceName:"流泪",facePath:"liulei.gif"},
		{faceName:"害羞",facePath:"haixiu.gif"},
		{faceName:"闭嘴",facePath:"bizui.gif"},
		{faceName:"大哭",facePath:"daku.gif"},
		{faceName:"尴尬",facePath:"ganga.gif"},
		{faceName:"发怒",facePath:"fanu.gif"},
		{faceName:"调皮",facePath:"tiaopi.gif"},
		{faceName:"龇牙",facePath:"ziya.gif"},
		{faceName:"惊讶",facePath:"jingya.gif"},
		{faceName:"难过",facePath:"nanguo.gif"},
		{faceName:"酷",facePath:"ku.gif"},
		{faceName:"冷汗",facePath:"lenghan.gif"},
		{faceName:"抓狂",facePath:"zhuakuang.gif"},
		{faceName:"吐",facePath:"tu.gif"},
		{faceName:"偷笑",facePath:"touxiao.gif"},
	    {faceName:"可爱",facePath:"keai.gif"},
		{faceName:"白眼",facePath:"baiyan.gif"},
		{faceName:"傲慢",facePath:"aoman.gif"},
		{faceName:"饥饿",facePath:"jie.gif"},
		{faceName:"困",facePath:"kun.gif"},
		{faceName:"惊恐",facePath:"jingkong.gif"},
		{faceName:"流汗",facePath:"liuhan.gif"},
		{faceName:"憨笑",facePath:"hanxiao.gif"},
		{faceName:"大兵",facePath:"dabing.gif"},
		{faceName:"奋斗",facePath:"fendou.gif"},
		{faceName:"咒骂",facePath:"zhouma.gif"},
		{faceName:"疑问",facePath:"yiwen.gif"},
		{faceName:"嘘",facePath:"xu.gif"},
		{faceName:"晕",facePath:"yun.gif"},
		{faceName:"折磨",facePath:"zhemo.gif"},
		{faceName:"衰",facePath:"shuai.gif"},
		{faceName:"骷髅",facePath:"kulou.gif"},
		{faceName:"敲打",facePath:"qiaoda.gif"},
		{faceName:"再见",facePath:"zaijian.gif"},
		{faceName:"擦汗",facePath:"cahan.gif"},
		{faceName:"抠鼻",facePath:"koubi.gif"},
		{faceName:"鼓掌",facePath:"guzhang.gif"},
		{faceName:"糗大了",facePath:"qiudale.gif"},
		{faceName:"坏笑",facePath:"huaixiao.gif"},
		{faceName:"左哼哼",facePath:"zuohengheng.gif"},
		{faceName:"右哼哼",facePath:"youhengheng.gif"},
		{faceName:"哈欠",facePath:"haqian.gif"},
		{faceName:"鄙视",facePath:"bishi.gif"},
		{faceName:"委屈",facePath:"weiqu.gif"},
		{faceName:"快哭了",facePath:"kuaikule.gif"},
		{faceName:"阴险",facePath:"yinxian.gif"},
		{faceName:"亲亲",facePath:"qinqin.gif"},
		{faceName:"吓",facePath:"xia.gif"},
		{faceName:"可怜",facePath:"kelian.gif"},
		{faceName:"菜刀",facePath:"caidao.gif"},
		{faceName:"西瓜",facePath:"xigua.gif"},
		{faceName:"啤酒",facePath:"pijiu.gif"},
		{faceName:"篮球",facePath:"lanqiu.gif"},
		{faceName:"乒乓",facePath:"pingpang.gif"},
		{faceName:"拥抱",facePath:"yongbao.gif"},
		{faceName:"握手",facePath:"woshou.gif"},
		{faceName:"得意地笑",facePath:"deyidexiao.gif"},
		{faceName:"听音乐",facePath:"tingyinyue.gif"}
	]
	,
	Init:function(class1,class2){
		var isShowImg=false;
		$(".imgBtn").click(function(){
			if(isShowImg==false){
				isShowImg=true;
			    $(this).parent().prev().animate({marginTop:"-125px"},300);
				if($('.faceDiv').children().length==0){
					for(var i=0;i<ImgIputHandler.facePath.length;i++){
						$('.faceDiv').append('<img title="'+ImgIputHandler.facePath[i].faceName+ '" src="../../img/'+ImgIputHandler.facePath[i].facePath+'" />');
					}
					$(".faceDiv>img").click(function(){
				 		isShowImg=false;
			            $(this).parent().animate({marginTop:"0px"},300);
						$("."+class1).append('<img title="'+$(this).attr('title')+ '" src="'+$(this).attr('src')+'" />');
						if($('.Input_Foot a.length_control').attr('data_value')<=$("."+class1).html().length){
						    $('.Input_Foot a.length_control').css('color','red');
						    if($('.Input_Foot a.length_control').attr('data_value')==$(this).html().length)
						    	$('.Input_Foot a.length_control').text($("."+class1).html().html().length+'/'+$('.Input_Foot a.length_control').attr('data_value'));
						    else
						    	$('.Input_Foot a.length_control').text('已超过' +($("."+class1).html().length-$('.Input_Foot a.length_control').attr('data_value'))+'个字');
						}
					   else{
						   $('.Input_Foot a.length_control').css('color','black');
						   $('.Input_Foot a.length_control').text($("."+class1).html().length+'/'+$('.Input_Foot a.length_control').attr('data_value'));
					   }
					});
				}
			}else{
				isShowImg=false;
			    $(this).parent().prev().animate({marginTop:"0px"},300);
			}
		});
	}
}